﻿@using PearAdminMvcApp.Tools
@model PearAdminMvcApp.Models.MenuCreateVm
@{
    ViewBag.Title = "添加子级菜单";
}


@using (@Html.BeginPearForm("createForm"))
{
    @Html.EditorFor(m => m.MenuName)
    @Html.EditorFor(m => m.Url)
    @Html.HiddenFor(m => m.ParentId)
    @Html.EditorFor(m => m.Icon)
    @Html.FormSubmitButton()
}
@section footer
{
    <script>
    layui.form.on("submit(formSubmit)", data => {
        layui.jquery.ajax({
            url: "/SysSetting/CreateMenu",
            data: data.field,
            type: "post"
        }).done(res => {
            if (res.code == 200) {
                window.parent.tools.notice.success("添加成功");
                window.parent.parent.location.reload();
            } else {
                window.parent.tools.notice.warning(res.msg);
            }
        }).fail(err => {
            window.parent.tools.notice.warning("添加失败");
        });

        return false;
    });
    </script>
}